<template>
  <div class="wf-box">
    <van-nav-bar
      :title="hardText"
      left-text="返回"
      right-text=""
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <router-view @click="getHardText"></router-view>
  </div>
</template>
<script>
import { Toast } from "vant";

export default {
  data() {
    return {
      hardText: "易理赔司机",
      isLongin:'',
    };
  },
  created() {
    this.hardText = this.$route.query.hardText
      ? this.$route.query.hardText
      : "易理赔司机";
      let isLongin=this.$store.state.userStore.user.idCard
      // console.log(isLongin);
      if(!isLongin){
        this.$router.push('/login')
      }

  },
  beforeUpdate() {
    this.hardText = this.$route.query.hardText
      ? this.$route.query.hardText
      : "易理赔司机";
  },
  methods: {
    getHardText() {
      this.hardText = this.$route.query.hardText
        ? this.$route.query.hardText
        : "服务列表";
    },
    onClickLeft() {
      // console.log("aaaa");
      history.back();
    },
    onClickRight() {
      Toast("按钮");
    },
    getHardText() {
      this.hardText = hardText;
    },
  },
  setup() {
    const onClickLeft = () => history.back();
    const onClickRight = () => Toast("按钮");
    return {
      onClickLeft,
      onClickRight,
    };
  },
};
</script>

<style lang="scss" scoped>
</style>